<template>
  <div>
    <h1>动态组件的使用</h1>
    <div>
      <button @click="comName='username'">账号密码填写</button>
      <button @click="comName='userinfo'">个人信息填写</button>
    </div>
    <!-- <username></username>
      <br>
    <userinfo></userinfo> -->
    <component :is="comName"></component>
  </div>
</template>

<script>
import username from "./components/userName.vue"
import userinfo from "./components/userInfo.vue"
export default {
  components: {
    username,
    userinfo
  },
  data(){
    return {
      comName: "username"
    }
  }
}
</script>

<style>

</style>